<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>接入申请</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
				<div class="layui-card-header"><i class="fa fa-cog"></i> 接入申请</div>
				<div class="layui-card-body" pad15>
					<blockquote class="layui-elem-quote">
						{if $authtype == 1}<p>完成接入流程需要使用微信开发者工具选择[10001:小程序交易组件测试用场景值]，请重新绑定选择手动绑定小程序，<a href="javascript:void(0)" onclick="openmax('{:url('Binding/index')}')">去绑定</a></p>{/if}
						<p>1、在小程序后台[功能-交易组件]中开启自定义版交易组件，然后开通商户号</p>
						{php}$hostip = @gethostbyname($_SERVER['SERVER_NAME']);{/php}
						<p>2、接入视频号必须开启小程序IP白名单，在小程序后台[开发-开发管理-开发设置-开发者ID-IP白名单]中设置{if $hostip}，IP白名单：{$hostip}{/if}</p>
						<p>3、必须开启消息推送，在小程序后台[开发-开发管理-开发设置-消息推送]中设置，<a href="javascript:void(0)" onclick="openmax('{:url('Binding/sdbangding')}/type/wx/isopen/1')">去设置</a></p>
						<p>4、设置商家信息，<a href="javascript:void(0)" onclick="openmax('{:url('Wxvideo/setinfo')}')">去设置</a></p>
						<p>5、上传商品等待审核通过，<a href="javascript:void(0)" onclick="openmax('{:url('ShopProduct/index')}&fromwxvideo=1')">去上传</a></p>
						<p>6、下载小程序代码（在小程序绑定界面点击上传代码，选择手动上传，然后点击打包下载），使用<a href="https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html" target="_blank">微信开发者工具</a>导入小程序代码，<a href="javascript:void(0)" onclick="openmax('{:url('Binding/index')}')">去下载</a></p></p>
						<p>7、在小程序开发者工具界面点击[普通编译-添加编译模式-进入场景选择10001:小程序交易组件测试用场景值]点击确定，选择已审核通过的商品进行下单使用微信支付进行付款</p>
						<p>8、在订单管理中对订单进行发货，<a href="javascript:void(0)" onclick="openmax('{:url('ShopOrder/index')}&fromwxvideo=1')">去发货</a></p>
						<p>9、在开发者工具[会员中心-订单列表]对订单申请退款，点击[退款-我要退款]申请退款</p>
						<p>10、在小程序后台交易组件内逐项点击完成，完成接入</p>
					</blockquote>
					<div class="layui-form" lay-filter="">
						
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">接入状态：</label>
							<div class="layui-form-mid">{if $statustxt=='已接入'}<span style="color:green">{$statustxt}</span>{else}{$statustxt}{/if}</div>
						</div>
						{if $access_info}
						
						<!-- <div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">客服链接或客服电话：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" id="service_agent" value="{if $service_agent_path}{$service_agent_path}{else}{$service_agent_phone}{/if}" class="layui-input">
							</div>
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" onclick="set_service_agent()">确定</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">填写客服电话或客服链接，客服链接必须是http开通的url地址</div>
						</div> -->
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">上传商品并审核成功：</label>
							<div class="layui-form-mid">{if $access_info.spu_audit_success==1}<span style="color:green">已完成</span>{else}未完成{/if}</div>
							{if $access_info.spu_audit_success==0}<button style="float:left;margin-left:60px" type="button" class="layui-btn layui-btn-primary" onclick="openmax('{:url('ShopProduct/index')}&fromwxvideo=1')">去完成</button>{/if}
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">发起一笔订单并支付成功：</label>
							<div class="layui-form-mid">{if $access_info.ec_order_success==1 || $access_info.pay_order_success==1}<span style="color:green">已完成</span>{else}未完成{/if}</div>
							<!-- {if $access_info.ec_order_success==0 && $access_info.spu_audit_success==1}<button style="float:left;margin-left:60px" type="button" class="layui-btn layui-btn-primary" onclick="openmax('{:url('luru')}')">去完成</button>{/if} -->
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">物流接口调用成功：</label>
							<div class="layui-form-mid">{if $access_info.send_delivery_success==1}<span style="color:green">已完成</span>{else}未完成{/if}</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">售后接口调用成功：</label>
							<div class="layui-form-mid">{if $access_info.ec_after_sale_success==1 || $access_info.add_aftersale_success==1}<span style="color:green">已完成</span>{else}未完成{/if}</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">商品接口调试完成：</label>
							<div class="layui-form-mid">{if $access_info.spu_audit_finished==1}<span style="color:green">已完成</span>{else}未完成{/if}</div>
							{if $access_info.spu_audit_finished==0}<button style="float:left;margin-left:60px" type="button" class="layui-btn layui-btn-primary" onclick="finish_access_info(6)">完成</button>{/if}
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">订单接口调试完成：</label>
							<div class="layui-form-mid">{if $access_info.ec_order_finished==1 || $access_info.pay_order_finished==1}<span style="color:green">已完成</span>{else}未完成{/if}</div>
							{if $access_info.ec_order_finished!=1 && $access_info.pay_order_finished!=1}<button style="float:left;margin-left:60px" type="button" class="layui-btn layui-btn-primary" onclick="finish_access_info(7)">完成</button>{/if}
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">物流接口调试完成：</label>
							<div class="layui-form-mid">{if $access_info.send_delivery_finished==1}<span style="color:green">已完成</span>{else}未完成{/if}</div>
							{if $access_info.send_delivery_finished==0}<button style="float:left;margin-left:60px" type="button" class="layui-btn layui-btn-primary" onclick="finish_access_info(8)">完成</button>{/if}
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">售后接口调试完成：</label>
							<div class="layui-form-mid">{if $access_info.ec_after_sale_finished==1 || $access_info.add_aftersale_finished==1}<span style="color:green">已完成</span>{else}未完成{/if}</div>
							{if $access_info.ec_after_sale_finished!=1 && $access_info.add_aftersale_finished!=1}<button style="float:left;margin-left:60px" type="button" class="layui-btn layui-btn-primary" onclick="finish_access_info(9)">完成</button>{/if}
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">测试完成：</label>
							<div class="layui-form-mid">{if $access_info.test_api_finished==1}<span style="color:green">已完成</span>{else}未完成{/if}</div>
							{if $access_info.test_api_finished==0}<button style="float:left;margin-left:60px" type="button" class="layui-btn layui-btn-primary" onclick="finish_access_info(10)">完成</button>{/if}
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:170px">发版完成：</label>
							<div class="layui-form-mid">{if $access_info.deploy_wxa_finished==1}<span style="color:green">已完成</span>{else}未完成{/if}</div>
							{if $access_info.deploy_wxa_finished==0}<button style="float:left;margin-left:60px" type="button" class="layui-btn layui-btn-primary" onclick="finish_access_info(11)">完成</button>{/if}
						</div>
						
						{/if}
						{if $statustxt == '未开通'}
						<div class="layui-form-item">
							<div class="layui-input-block" style="margin-left:200px;">
								<button class="layui-btn" lay-submit lay-filter="formsubmit">申请开通</button>
							</div>
						</div>
						{/if}
					</div>
				</div>
			</div>
    </div>
  </div>
	{include file="public/js"/}
	<script>
	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
		$.post("",field,function(data){
			dialog(data.msg,data.status,data.url);
		})
	})
	function set_service_agent(){
		var service_agent = $('#service_agent').val();
		$.post("{:url('set_service_agent')}",{service_agent:service_agent},function(data){
			dialog(data.msg,data.status,data.url);
		})
	}
	function finish_access_info(access_info_item){
		var index = layer.load();
		$.post("{:url('finish_access_info')}",{access_info_item:access_info_item},function(data){
			layer.close(index);
			dialog(data.msg,data.status,true);
		})
	}
  </script>
	{include file="public/copyright"/}
</body>
</html>